Skip to content

ENH: support reading box vectors from TPR files - #5466

Open
AkshitBoora wants to merge 1 commit into
MDAnalysis:developfrom
AkshitBoora:fix-tpr-box-5375
Open

ENH: support reading box vectors from TPR files#5466
AkshitBoora wants to merge 1 commit into
MDAnalysis:developfrom
AkshitBoora:fix-tpr-box-5375

Conversation

@AkshitBoora

Copy link
Copy Markdown

Fixes #5375

Changes made in this Pull Request:

  • Modified TPRReader._read_first_frame() in package/MDAnalysis/coordinates/TPR.py to capture the Box tuple from extract_box_info() and set ts.dimensions = triclinic_box(*box_info.size).
  • Added unit conversion (convert_units=True converts nm to Å; convert_units=False preserves nm) following MDAnalysis coordinate reader standards.
  • Added comprehensive unit tests in testsuite/MDAnalysisTests/coordinates/test_tpr.py for single (mda.Universe(tpr)) and double (mda.Universe(tpr, tpr)) TPR universes across different GROMACS TPR versions.
  • Updated package/CHANGELOG.

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: No

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS? (If it is not, add it!)
  • I have read and understand the current AI Policy
  • LLM/AI disclosure was updated.

Developers Certificate of Origin

I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.87%. Comparing base (8b8875c) to head (d14fb44).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5466   +/-   ##
========================================
  Coverage    93.87%   93.87%           
========================================
  Files          182      182           
  Lines        22522    22526    +4     
  Branches      3206     3207    +1     
========================================
+ Hits         21143    21147    +4     
  Misses         917      917           
  Partials       462      462           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@read-the-docs-community

read-the-docs-community Bot commented Sep 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: support reading box vectors from TPR files

1 participant